import React from "react";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import InterviewType from "../screens/interview/InterviewType";
import InterviewList from "../screens/interview/InterviewList";
import InterviewListAdmin from "../screens/interview/InterviewListAdmin";
import InterviewAdd from "../screens/interview/InterviewAdd";
import InterviewDetail from "../screens/interview/InterviewDetail";
import InterviewEdit from "../screens/interview/InterviewEdit";
import { InterviewProvider } from "../context/interview/InterviewContext";
import { Feather } from "@expo/vector-icons";
const Stack = createNativeStackNavigator();

const InterviewNavigation = ({ navigation }) => {
  return (
    <InterviewProvider>
      <Stack.Navigator
        initialRouteName="InterviewType"
        screenOptions={{
          headerTitleAlign: "center",
          headerTintColor: "#fff",
          headerStyle: {
            backgroundColor: "#A80108",
          },
        }}
      >
        <Stack.Screen
          name="InterviewType"
          component={InterviewType}
          options={{
            headerShown: true,
            title: "访谈",
            headerLeft: () => (
              <Feather
                name="user"
                style={{ padding: 5 }}
                size={25}
                color="#fff"
                onPress={() => navigation.openDrawer()}
              />
            ),
          }}
        />
        <Stack.Screen
          name="InterviewList"
          component={InterviewList}
          options={{ headerShown: false }}
        />
        <Stack.Screen
          name="InterviewListAdmin"
          component={InterviewListAdmin}
          options={{ headerShown: false }}
        />
        {/* 添加页面 */}
        <Stack.Screen
          name="InterviewAdd"
          component={InterviewAdd}
          options={{
            headerShown: true,
            title: "添加访谈",
          }}
        />
        {/* 查看页面 */}
        <Stack.Screen
          name="InterviewDetail"
          component={InterviewDetail}
          options={{
            headerShown: false,
          }}
        />
        {/* 编辑页面 */}
        <Stack.Screen
          name="InterviewEdit"
          component={InterviewEdit}
          options={{
            headerShown: true,
            title: "编辑访谈",
          }}
        />
      </Stack.Navigator>
    </InterviewProvider>
  );
};

export default InterviewNavigation;
